﻿using PerpheralDevice;
using System.Diagnostics.CodeAnalysis;

namespace AppMachine.Domain.LogicCom;

/// <summary>
/// 应用组件配置
/// </summary>
public interface IComConfigRepository {
    IQueryable<IComConfig> GetAll(string typeCom=null);
    /// <summary>
    /// 针对应用组件的查询(可能是原子组件)
    /// </summary>
    /// <param name="comID">应用组件ID</param>
    /// <returns></returns>
    IComConfig Query(string comID);
    /// <summary>
    /// 针对原子组件的查询(该属性暂时仅针对原子组件 DI,DO,伺服)
    /// </summary>
    /// <param name="devID">外设ID</param>
    /// <param name="unitID">外设单元ID</param>
    /// <param name="unitID">外设单元类型(DI,DO,伺服 三者中的一种)</param>
    /// <returns></returns>
    IComConfig Query(string devID, string unitID, string comType);
    IComConfig InsertOrUpdate([NotNull] IComConfig comConfig);
    void Delete([NotNull] IComConfig comConfig);
}
